import request from './request.js';
import request_app from './request_app.js';
// 获取商户商品列表
export const productlist = (params) => {
  return request('/system/product/list', params, 'get');
};
// 新增商品
export const systemproduct = (params) => {
  return request('/system/product', params, 'post');
};
// 商品类别
export const categorylist = (params) => {
  return request('/system/category/list?pageNum=1&pageSize=100', params, 'get');
};
// 获取用户信息详情
export const merlist = (params) => {
  return request('/system/mer/list', params, 'get');
};
// 查询商品信息详情
export const productInfo = (params) => {
  return request('/system/product/' + params, {}, 'get');
};
// 修改商品 接口
export const productput = (params) => {
  return request('/system/product', params, 'put');
};
//获取个人信息
export const getUserInfo = (params) => {
  return request('/system/mer/' + params, {}, 'get');
};
// 删除商品信息
export const productDel = (params) => {
  return request('/system/product/' + params, {}, 'delete');
};
// 活动列表
export const activitylist = (params) => {
  return request('/system/activity/list', params, 'get');
};
// 删除活动
export const activitydel = (params) => {
  return request('/system/activity/' + params, {}, 'delete');
};
// 获取商品信息
export const getMerInfoByid = (params) => {
  return request_app('/localfife/getMerInfoByid', params, 'get');
};
// 添加活动
export const addOrUpdateReId = (params) => {
  return request('/system/activity/addOrUpdateReId', params, 'post');
};
// 获取消费券
export const activityById = (params) => {
  return request('/system/activity/' + params, {}, 'get');
};
// 新增消费券
export const addOrUpdateGather = (params) => {
  return request('/ticket/addOrUpdateGatherApp', params, 'post');
};

// 删除商品
export const delProduct = (params) => {
  return request('/system/ticketProduct/' + params, {}, 'delete');
};
// 删除供应商/商户 活动券  需要关联真实商品  xz
export const delTicket = (params) => {
  return request('/ticket/' + params, {}, 'delete');
};

// 申请
export const merInviteUserIntegraExchange = (params) => {
  return request('/system/merInviteUserIntegraExchange', params, 'post');
};

export const merInviteUsraExchangelist = (params) => {
  return request('/system/merInviteUserIntegraExchange/list', params, 'get');
};
// 查询商户活动分类数据列表
export function ActlistCategory(query) {
  return request({
    url: '/system/activity/category/list',
    method: 'get',
    params: query
  });
}

// 查询商户活动分类数据详细
export function ActgetCategory(id) {
  return request({
    url: '/system/activity/category/' + id,
    method: 'get'
  });
}

// 新增商户活动分类数据
export function ActaddCategory(data) {
  return request({
    url: '/system/activity/category',
    method: 'post',
    data: data
  });
}

// 修改商户活动分类数据
export function ActupdateCategory(data) {
  return request({
    url: '/system/activity/category/export',
    method: 'put',
    data: data
  });
}

// 删除商户活动分类数据
export function ActdelCategory(ids) {
  return request({
    url: '/system/activity/category/' + ids,
    method: 'delete'
  });
}
/* 供应商推送活动添加接口 */
export function addActivity(data) {
  return request({
    url: '/system/activity/push',
    method: 'post',
    data: data
  });
}
/* 优惠券添加接口 */

export const addCoupon = (data) => {
  return request('/marketing/coupon/save', data, 'post');
};
/* 优惠券列表接口 */

export const couponlist = (params) => {
  return request('/marketing/coupon/list', params, 'get');
};
/* 优惠券状态修改 */
export const couponStatus = (data) => {
  return request('/marketing/coupon/update/status?id='+data.id +'&status='+data.status, data, 'post');
  };
  /* 优惠券删除 */
  export const couponDel = (data) => {
  return request('/marketing/coupon/delete?id='+data.id, data, 'post');
};